#define _CRT_SECURE_NO_WARNINGS
#include "Constants.h"
#include "CaseSettings.h"
#include "ModelSettings.h"
#include "Flowfield.h"

#include "WallGeometry.h"
#include "Cphase.h"
#include "Flag.h"
#include "Particle.h"
#include "mathParticleTracking.h"
using namespace std;

int main() {
	auto constant0 = make_shared<Constants>();
	string caseSetting = "inCaseSettings.txt", inletFile = "inInletFlowSettings.txt";
	auto caseSettings0 = make_shared<CaseSettings>(caseSetting, inletFile);
	string modelSetting = "inModelSettings.txt";
	auto modelSettings0 = make_shared<ModelSettings>(modelSetting);
	auto flowfield0 = make_shared<Flowfield>(modelSettings0, caseSettings0);
	auto wallGeometry0 = make_shared<WallGeometry>(caseSettings0);
	Cphase cphaseCurrent(caseSettings0, constant0);
	double testXpos = 0.0;
	cphaseCurrent.V[0] = (*flowfield0).GetGasVelocityX(testXpos);
	cphaseCurrent.V[1] = (*modelSettings0).gVy;

	Flag pFlag;
	Particle pCurrent;
	pCurrent.ID = 0; pCurrent.pos[0] = 0.0; pCurrent.pos[1] = 0.1;
	vector<double> interpVx = { 0.1,0.2,0.3,0.4 }, interpVy = { 20.0,30.0,40.0,50.0 };
	double testX = 0.25;
	double testY = interp1(testX, interpVx, interpVy);

	// Output the test data                 //
	cout << "//*********Output the test data*********//" << endl;
	cout << "Test 1: cphaseCurrent.V[0] = " << cphaseCurrent.V[0] << endl;
	cout << "Test 2: cphaseCurrent.V[1] = " << cphaseCurrent.V[1] << endl;
	cout << "Test 3: pFlag.active = " << pFlag.active << endl;
	cout << "Test 4: pCurrent.ID = " << pCurrent.ID << ", pCurrent.pos[1] = " << pCurrent.pos[1] << endl;
	cout << "Test 5: testX = " << testX << " ->using interp1-> testY = " << testY << endl;
	return 1;
}
